package com.city.springcloud.service;

import com.city.springcloud.entity.Dept;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: Cheng
 * Date: 2020/5/4
 * Time: 16:14
 * Description: No Description
 *
 * api公共层把服务全部转为接口给feign形式的服务消费者来使用，dept-80为http请求，dept-feign为接口请求
 */
@Component
@FeignClient(value = "city",fallbackFactory = DeptClientServiceFallbackFactory.class)
//fallbackFactory = DeptClientServiceFallbackFactory.class 服务降级
public interface DeptClientService {
    @GetMapping("/dept/list")
    List<Dept> list();
    @PostMapping("/dept/addDept")
    boolean addDept(Dept dept);
}
